package com.crm.customers.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.crm.customers.dao.CustomerCategoryDao;
import com.crm.customers.model.CustomerCategory;
import com.crm.customers.service.CustomerCategoryService;

@Service("customerCategoryService")
public class CustomerCategoryServiceImpl implements CustomerCategoryService {

	@Autowired
	private CustomerCategoryDao customerCategoryDao;
	
	@Override
	public CustomerCategory insertCustomerCategory(CustomerCategory cc) {
		return customerCategoryDao.insertCustomerCategory(cc);
	}

	@Override
	public CustomerCategory getCustomerCategoryById(Long id) {
		return customerCategoryDao.getCustomerCategoryListByCategoryId(id);
	}

	@Override
	public CustomerCategory updateCustomerCategory(CustomerCategory cc) {
		return customerCategoryDao.updateCustomerCategory(cc);
	}

	@Override
	public List<CustomerCategory> getCustomerCatrgoryByCustomerId(Long cusid) {
		return customerCategoryDao.getCustomerCategoryListById(cusid);
	}

	@Override
	public List<CustomerCategory> getCustomerCategoryListByParams(
			CustomerCategory cc, Integer pageNo, Integer pageSize) {
		cc.setStartsize((pageNo-1)*pageSize);
		cc.setEndsize(pageSize);
		List<CustomerCategory> list = customerCategoryDao.getCustomerCategoryListByParams(cc);
		return list;
	}
	
	

}
